//
//  ImageDownloader.h
//  Douban
//
//  Created by lanou3g on 15-3-12.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@class ImageDownloader;
@protocol ImageDownloaderDelegate<NSObject>
@optional
- (void)imageDownloader:(ImageDownloader *)imageDowndloader didiFinshLoadImage:(UIImage *)image;
- (void)imageDownloader:(ImageDownloader *)imageDowndloader failWithError:(NSError *)error;

@end

@interface ImageDownloader : NSObject<NSURLConnectionDataDelegate>
- (instancetype)initWithURLString:(NSString *)urlString delegate:(id<ImageDownloaderDelegate>)delegate tag:(NSInteger)tag;
+ (ImageDownloader*)imageDownloaderWithURLString:(NSString *)urlString delegate:(id<ImageDownloaderDelegate>)delegate tag:(NSInteger)tag;

@end
